home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / ARexx / 03 / 08.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-08-07  |  4.1 KB  |  211 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. if exists("libs:flyer.library") then do
  12.     TOASTERLIB="ToasterARexx.port"
  13.     call remlib('ToasterARexx.port')
  14.     call remlib('PROJECT_REXX_PORT')
  15.     call addlib('PROJECT_REXX_PORT' , 0)
  16.     call addlib(TOASTERLIB,0)
  17.     end
  18. call Settings()
  19. call open TempFile,"VFXIFX:TempDrawer/"FXNum".txt",R
  20. line = readln(TempFile)
  21. PicAName = strip(line)
  22. line = readln(TempFile)
  23. Start = strip(line)
  24. line = readln(TempFile)
  25. End = strip(line)
  26. line = readln(TempFile)
  27. IAType = strip(line)
  28. line = readln(TempFile)
  29. CompTotal = strip(line)
  30. do i = 1 to CompTotal
  31.     line = readln(TempFile)
  32.     PicName.i = strip(line)
  33.     line = readln(TempFile)
  34.     Start.i = strip(line)
  35.     line = readln(TempFile)
  36.     End.i = strip(line)
  37.     line = readln(TempFile)
  38.     IAType.i = strip(line)
  39.     line = readln(TempFile)
  40.     BlendNum.i = strip(line)
  41.     line = readln(TempFile)
  42.     InType.i = strip(line)
  43.     line = readln(TempFile)
  44.     OutType.i = strip(line)
  45.     line = readln(TempFile)
  46.     FadeIn.i = strip(line)
  47.     line = readln(TempFile)
  48.     FadeOut.i = strip(line)
  49.     end
  50. call close TempFile
  51.  
  52. Frames = (End - Start)+1
  53. j=0
  54. k=0
  55. TFrames = Frames
  56. TNum = 3
  57. if TFrames > 999 then TNum = 4
  58. if TFrames > 9999 then TNum = 5
  59. if Field = 1 then TFrames = Frames*2
  60. do i = Start to End
  61.     k = k+ 1
  62.     call open TempFile,"RAM:VFXNums",W
  63.     call writeln TempFile,right(k,5,'0')
  64.     call writeln TempFile,right(Frames,5,'0')
  65.     call close TempFile
  66.     f=0
  67.     Redraw Off
  68.     j = j+ 1
  69.     FieldSet = 0
  70.     call DoIt()
  71.     Redraw On
  72.     call SaveIt()
  73.         if Field = 1 then do
  74.             Redraw Off
  75.             j = j + 1
  76.             FieldSet = 1
  77.             call DoIt()
  78.             Redraw On
  79.             call SaveIt()
  80.             end 
  81.     end
  82.     Undo On
  83. exit
  84.  
  85.  
  86.  
  87. LoadA:
  88.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  89.         Undo On
  90.         exit
  91.         end
  92.     if IAType = 0 then do
  93.         LoadBuffer PicAName Force i
  94.         end
  95.     if IAType = 1 then do
  96.         LoadBuffer PicAName Force 1
  97.         end
  98.     if IAType = 2 then do
  99.         LoadBuffer PicAName Force
  100.         end
  101.     if IAType = 3 then do
  102.         LoadBuffer PicAName""right(i,TNum,'0') Force
  103.         end
  104. return
  105.  
  106.  
  107. LoadAll:
  108.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  109.         Undo On
  110.         exit
  111.         end
  112.     if IAType.all = 0 then do
  113.         LoadBuffer PicName.all Force (k+Start.all)-1
  114.         end
  115.     if IAType.all = 1 then do
  116.         LoadBuffer PicName.all Force 1
  117.         end
  118.     if IAType.all = 2 then do
  119.         LoadBuffer PicName.all Force
  120.         end
  121.     if IAType.all = 3 then do
  122.         LoadBuffer PicName.all""right((k+Start.all)-1,TNum,'0') Force
  123.         end
  124. return
  125.  
  126.  
  127. SaveIt:
  128.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  129.         Undo On
  130.         exit
  131.         end
  132.     if SaveType = 0 then do
  133.         call Switcher(TOSW)
  134.         call Switcher(MDV1)
  135.  
  136.         Render Go
  137.         if Field = 1 then
  138.                 call RecordAdd(SaveName,1,6,Compression)
  139.         else
  140.                 call RecordAdd(SaveName,2,6,Compression)
  141.         if j = TFrames then
  142.             call MakeIcon(SaveName,(Frames-10))
  143.         end
  144.  
  145.     if SaveType = 1 then do
  146.         if Field = 1 then do
  147.             f= f + 1
  148.             if f = 1 then
  149.                 SaveBufferAs ILBM "VFXIFX:TempDrawer/PicA"
  150.             if f = 2 then do
  151.                 GetMain
  152.                 parse var result Name Width Height Blah
  153.                 Scale Width Height/2
  154.                 Swap
  155.                 LoadBuffer "VFXIFX:TempDrawer/PicA" Force
  156.                 Scale Width Height/2
  157.                 Hook Interlace
  158.                 SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  159.                 f = 0
  160.                 end
  161.             end
  162.         else do
  163.             SaveBufferAs ILBM SaveName""right(k,TNum,'0')
  164.             end    
  165.         end
  166.  
  167. return
  168.  
  169.  
  170. DoIt:
  171.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  172.         Undo On
  173.         exit
  174.         end
  175.  
  176.     DrawStyle Normal
  177.     Blend 100
  178.     call LoadA()
  179.     DrawStyle RubThrough
  180.     GetMain
  181.     parse var result Name Width Height Blah
  182.     if j = 1 then do
  183.         do all = 1 to CompTotal
  184.             aa.all = 0
  185.             end
  186.         end
  187.     do all = 1 to CompTotal
  188.         Swap
  189.         call LoadAll()
  190.         Swap
  191.         FadeNum = BlendNum.all
  192.         if FadeIn.all > 0 & j <= FadeIn.all then do
  193.             FadeNum = trunc(((j-1) * BlendNum.all) / (FadeIn.all-1))
  194.             if FadeNum > BlendNum.all then FadeNum = BlendNum.all
  195.             end
  196.         if FadeOut.all > 0 & j >= (TFrames-FadeOut.all) then do
  197.             aa.all = aa.all +1
  198.             FadeNum = trunc(BlendNum.all-((aa.all-1) * BlendNum.all) / (FadeOut.all-1))
  199.             if FadeNum > BlendNum.all then FadeNum = BlendNum.all
  200.             end
  201.         Blend FadeNum
  202.         FilledBox 0 0 Width Height
  203.         end
  204.  
  205.     DrawStyle Normal
  206.     Blend 100
  207.  
  208. return
  209.  
  210.  
  211.